package com.buer.train.business.service.impl;

import com.buer.train.business.dao.TrainningTeacherDao;
import com.buer.train.business.domain.TrainningTeacherDO;
import com.buer.train.business.service.TrainningTeacherService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class TrainningTeacherServiceImpl implements TrainningTeacherService {
	@Autowired
	private TrainningTeacherDao trainningTeacherDao;
	
	@Override
	public TrainningTeacherDO get(Integer id){
		return trainningTeacherDao.get(id);
	}
	
	@Override
	public List<TrainningTeacherDO> list(Map<String, Object> map){
		return trainningTeacherDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return trainningTeacherDao.count(map);
	}
	
	@Override
	public int save(TrainningTeacherDO trainningTeacher){
		return trainningTeacherDao.save(trainningTeacher);
	}
	
	@Override
	public int update(TrainningTeacherDO trainningTeacher){
		return trainningTeacherDao.update(trainningTeacher);
	}
	
	@Override
	public int remove(Integer id){
		return trainningTeacherDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return trainningTeacherDao.batchRemove(ids);
	}

    @Override
    public PageInfo<TrainningTeacherDO> getTrainningTeacherList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<TrainningTeacherDO> list = trainningTeacherDao.getTrainningTeacherList(map); // 获取数据
        PageInfo<TrainningTeacherDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public TrainningTeacherDO getOne(Map<String, Object> map){
        return trainningTeacherDao.getOne(map);
    }
	
}
